# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=rtw89-src
_modname=rtw89
pkgver=7_p20220307
_gitrev=cacf367ba8ec23ca403bcf1fa3838a27cebdc275
pkgrel=0
pkgdesc="Driver for Realtek 8852AE, an 802.11ax device for Linux <5.16 (sources)"
url="https://github.com/lwfinger/rtw89"
arch="noarch"
license="GPL-2.0-or-later"
source="https://github.com/lwfinger/rtw89/archive/$_gitrev/$_modname-$_gitrev.tar.gz"
builddir="$srcdir/rtw89-$_gitrev"
options="!check"  # just sources

prepare() {
	default_prepare

	cat >AKMBUILD <<-EOF
	modname=$_modname
	modver=$pkgver-r$pkgrel
	built_modules='rtw89core.ko rtw89pci.ko'
	EOF
}

package() {
	install -D -m644 -t "$pkgdir"/usr/src/$_modname-$pkgver \
		*.c *.h *.bin Makefile AKMBUILD
}

sha512sums="
7233b32372a093912bef23c4b5b57fb95b325d1a67c4fc804c470c8125303b98b4ddec172faa6d0ab7223db26dc7881bad7b9652e82653dda8e41d34a460e14e  rtw89-cacf367ba8ec23ca403bcf1fa3838a27cebdc275.tar.gz
"
